package com.tedu.service.Impl;

import com.tedu.dao.mapper.CommentMapper;
import com.tedu.dao.repository.ICommentRepository;
import com.tedu.dao.repository.Impl.CommentRepositoryImpl;
import com.tedu.pojo.entity.Comment;
import com.tedu.pojo.param.CommentParam;
import com.tedu.service.ICommentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements ICommentService {
    @Autowired
    private ICommentRepository commentRepository;

    @Override
    public int addComment(Comment comment) {
        commentRepository.addComment(comment);
        return 0;
    }

    @Override
    public int deleteComment(Integer id) {
        commentRepository.deleteComment(id);
        return 0;
    }

    @Override
    public int UpdateComment(Comment comment) {
        commentRepository.UpdateComment(comment);
        return 0;
    }

    @Override
    public List<Comment> selectAllComment() {
        return commentRepository.selectAllComment();
    }

    @Override
    public CommentParam selectOne(Integer id) {
        return commentRepository.selectOne(id);
    }
}